package com.atguigu.edupublisher.mapper;

import com.atguigu.edupublisher.beans.TrafficUvCt;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @ClassName TrafficStatsMapper
 * @Description TODO
 * @Author$ 邢家俊
 * @Date 2023-5-8 20:23
 * @Version 1.0
 **/
public interface TrafficStatsMapper {


    // @Select("select ch,sum(uv_ct) uv_ct from dws_traffic_vc_ch_ar_is_new_page_view_window " +
    //        " where toYYYYMMDD(stt) = #{date} group by ch order by uv_ct desc limit #{limit}")
    //    List<TrafficUvCt> selectChUvCt(@Param("date") Integer date, @Param("limit") Integer limit);

    @Select("select ch , sum(pv_ct) pv_sum  from dws_traffic_vc_ch_ar_is_new_page_view_window where \n" +
            "toYYYYMMDD(stt)=#{date} group by ch order by pv_sum desc limit #{limit}")
    List<TrafficUvCt> selectChUvCt(@Param(value = "date") Integer date , @Param(value = "limit") Integer limit);



}